function [hFeature, ImgNum, ImgMean, scale, layer, hImgRead] = parseDeepFeatures(network, feature, bImResize, dbname)

%% user define
% bGPU = false;
% bImResize = false;
% bImResize = true;

% network = 'DeepID';
% network = 'VGG';
% network = 'LightenedCNN';

if nargin < 4
    dbname = '';
end

MinBatchSize = 50;
[NetFile, WeightsFile, ImgMean, scale, layer] = mycaffe.getNetSetting(network, feature);
[hImgRead, hImgProc, ImgNum] = mycaffe.getImgSetting(dbname, ImgMean, bImResize, scale);

hFeature = @(ImgIndex) mycaffe.produceDeepFeatures(NetFile, WeightsFile, layer, MinBatchSize, ImgIndex, hImgRead, hImgProc);
